package com.stormrage.edu.serv.edu.view.impl;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stormrage.edu.dao.edu.view.EduProjectMajorDao;
import com.stormrage.edu.serv.edu.view.EduProjectMajorServ;
import com.stormrage.entity.edu.view.EduProjectMajor;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @author www.stormragetech.com
 * @date 2016年1月19日
 * @version 1.0.0
 */
@Service
public class EduProjectMajorServImpl implements EduProjectMajorServ {

	private static final Logger logger = LoggerFactory.getLogger(EduProjectMajorServ.class);

	@Autowired
	private EduProjectMajorDao eduProjectMajorDao;

	@Override
	public Integer create(final EduProjectMajor arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 Create 】- 开始运行 ");

		Integer index = eduProjectMajorDao.create(arg0);

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 Create 】- 完成运行 ");
		return index;
	}

	@Override
	public void deleteById(final Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 DeleteById 】- 开始运行 ");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		eduProjectMajorDao.deleteById(map);

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 DeleteById 】- 完成运行 ");
	}

	@Override
	public void deleteByProjectId(final Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 DeleteByProjectId 】- 开始运行 ");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		eduProjectMajorDao.deleteByProjectId(map);

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 DeleteByProjectId 】- 完成运行 ");
	}

	@Override
	public void deleteByMajorId(final Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 DeleteByMajorId 】- 开始运行 ");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		eduProjectMajorDao.deleteByMajorId(map);

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 DeleteByMajorId 】- 完成运行 ");
	}

	@Override
	public Integer queryCountById(final Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 QueryCountById 】- 开始运行 ");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		Integer count = eduProjectMajorDao.queryCountById(map);

		logger.debug(" 【 Serv 】- 【 EduProjectMajorServ 】- 【 QueryCountById 】- 完成运行 ");
		return count;
	}

}
